import { makeAutoObservable, autorun, configure } from "mobx";

//configure({ enforceActions: "observed" });

class CounterStore {

  count = 0;

  constructor() {
    makeAutoObservable(this);
    autorun(() => {
      console.log(`Count changed: ${this.count}`);
    });
  }


  increment() {
    this.count += 1;
  }

  decrement() {
    this.count -= 1;
  }

  reset(){
    this.count = 0;
  }
}

export default CounterStore;
